// pages/datalist/datalist.js
var app = getApp();
Page({
  data: {
  },
  onLoad: function (options) {
    // 页面初始化 options为页面跳转所带来的参数
    let that = this;
    wx.getStorage({
      key: 'userInfo',
      success: function(res){
        that.setData({'patientid':res.data.patientid})
      }
    })
    getData(that,options);
  },
  onShareAppMessage: function () {
    return {
      title: '我已完成周打卡'
    }
  }
})
//获取本次打卡信息和用户信息
function getData(that,options) {
   app.https.get(that,'/IbabyWebService/camp/dietDetail/'+options.id,{},function(res){
      res.detail = JSON.parse(res.detail);
      console.log(res);
      that.setData({
        clock: res
      })
      app.https.get(that,'/IbabyWebService/Manage/AppUser/brief?patientid='+res.patientid,{},function(rel){
        that.setData({
          userInfo: rel
        })
      })
    })
}